﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

namespace Twitter
{
    [Serializable]
    [System.Xml.Serialization.XmlType("statuses", Namespace = "")] 
    public class TweetsCollection: System.Collections.Generic.ICollection<Tweet>
    {
        #region Private member variables
        private List<Tweet> List = new List<Tweet>();
        //public Tweet[] Items;
        #endregion

        #region Constructors, destructors and initializers
        public TweetsCollection() { }

        public TweetsCollection(IEnumerable<Tweet> collection)
        {
            List.AddRange(collection);
        }
        #endregion

        #region Private methods
        #endregion


        #region Protected methods
        #endregion

        #region Public methods

        public int IndexOf(Tweet val)
        {
            return (List.IndexOf(val));
        }

        public void Remove(Tweet val)
        {
            List.Remove(val);
        }

        public Tweet[] ToArray()
        {
            return List.ToArray();
        }

        #endregion

        #region Protected properties
        #endregion

        #region Public properties

        public Tweet this[int index]
        {
            get
            {
                return ((Tweet)List[index]);
            }
            set
            {
                List[index] = value;
            }
        }

        #endregion

        #region ICollection<Tweet> Members

        public void Add(Tweet item)
        {
            List.Add(item);
        }

        public void Clear()
        {
            List.Clear();
        }

        public bool Contains(Tweet item)
        {
            return List.Contains(item);
        }

        public void CopyTo(Tweet[] array, int arrayIndex)
        {
            List.CopyTo(array, arrayIndex);
        }

        public int Count
        {
            get { return List.Count; }
        }

        public bool IsReadOnly
        {
            get { return false; }
        }

        #endregion

         #region ICollection<Tweet> Members


         bool ICollection<Tweet>.Remove(Tweet item)
         {
             throw new NotImplementedException();
         }

         #endregion

         #region IEnumerable<Tweet> Members

         public IEnumerator<Tweet> GetEnumerator()
         {
             return List.GetEnumerator();
         }

         #endregion

         #region IEnumerable Members

         System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
         {
             return List.GetEnumerator();
         }

         #endregion
    }
}
